package com.junxonline.instant.dao.entity.dto.ui;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * TreeSelectNode实体类
 *
 * @author JunX
 * @date 2021-01-02
 */
@Data
@AllArgsConstructor
public class TreeSelectNodeDTO implements Serializable {

    /**
     * 唯一标识
     */
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long key;

    /**
     * 值
     */
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long value;

    /**
     * 标签
     */
    private String title;

    /**
     * 类型
     */
    private Integer type;

    /**
     * 自定义标题
     */
    private String customTitle;


    /**
     * 节点插槽
     */
    private Map<String, String> scopedSlots;

    /**
     * 子节点
     */
    private List<TreeSelectNodeDTO> children;

    public TreeSelectNodeDTO(Long key, Long value, String title) {
        this.key = key;
        this.value = value;
        this.title = title;
    }

    public TreeSelectNodeDTO(Long key, Long value, String title, Map<String, String> scopedSlots) {
        this.key = key;
        this.value = value;
        this.title = title;
        this.scopedSlots = scopedSlots;
    }

    public TreeSelectNodeDTO(Long key, Long value, String title, Integer type) {
        this.key = key;
        this.value = value;
        this.title = title;
        this.type = type;
    }

    public TreeSelectNodeDTO(Long key, Long value, String title, Integer type, Map<String, String> scopedSlots) {
        this.key = key;
        this.value = value;
        this.title = title;
        this.type = type;
        this.scopedSlots = scopedSlots;
    }

    public TreeSelectNodeDTO(Long key, Long value, String title, String customTitle, Integer type, Map<String, String> scopedSlots) {
        this.key = key;
        this.value = value;
        this.title = title;
        this.type = type;
        this.customTitle = customTitle;
        this.scopedSlots = scopedSlots;
    }

}
